package il.ac.braude.sona.gui.forms.myforms;

import il.ac.braude.sona.constants.Resources;
import il.ac.braude.sona.gui.forms.FormFrame;
import il.ac.braude.sona.gui.forms.FormPanel;
import il.ac.braude.sona.gui.forms.questions.QPassword;
import il.ac.braude.sona.gui.forms.questions.QTextField;

import javax.swing.JFrame;

/**
 * Form that the user must fill to login to the system
 * sets the password as necessary field 
 * waits for user input which will be
 * handled by the controller
 * @author  Ofek Ron
 * @author Avihay Avitan
 * @author Nitzan Inbar
 * @author Sasha Rozenthal
 */
@SuppressWarnings("serial")
public class LoginForm extends FormFrame {

	public LoginForm() {
		super(Resources.Strings.LoginFormTitle,Resources.Strings.Signin);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		FormPanel form = new FormPanel();
		form.addTitleWithUnderline(Resources.Strings.LoginTitle);
		form.addQuestion(new QTextField(Resources.Strings.UserName));
		QPassword pass = new QPassword(Resources.Strings.Password);
		pass.setNecessary(true);
		form.addQuestion(pass);
		setFormPanel(form);
		setResizable(false);
	}



}
